package com.clickpaas.governmentcloud.entity.portalentity.rep;

import lombok.ToString;

/**
 * @author 方延杰
 * @version 1.0
 * @since 2018/9/23 4:20 下午
 */
@ToString
public enum CommonCode implements ResultCode {

    //成功返回数据
    SUCCESS(true, 200, "处理成功"),
    FAIL(false, 500, "处理失败"),
    AUTHFAIL(false, 401, "tokenId认证失败,无权限");
    final boolean success;
    final Integer code;
    final String msg;

    CommonCode(boolean success, Integer code, String msg) {
        this.success = success;
        this.code = code;
        this.msg = msg;
    }

    @Override
    public boolean success() {
        return success;
    }

    @Override
    public Integer code() {
        return code;
    }

    @Override
    public String msg() {
        return msg;
    }
}